The present invention relates to a method for preserving changes to a configuration of a running virtual machine. The present invention further relates to a computer-readable medium such as a storage device, a floppy disk, CD, DVD, Blu-Ray disk, or a random access memory (RAM), containing a set of instruction that causes a computer to perform the above method. The present invention further relates to a computer program product comprising a computer usable medium including computer usable program code, wherein the computer usable program code is adopted to execute the above method.
Virtualization is becoming more and more important in IT systems, as it allows the use of central servers for performing different tasks as required by a user. This includes, that different operating systems can run on a single hardware environment, which offers high flexibility for the user. A virtual machine manager, also called hypervisor, is running on the hardware environment and provides an environment for execution of virtual machines, which are also called guests, for executing the each one operating system. The guests are virtual instances of operating systems, which are encapsulated inside the virtual machine manager and can be executed like running directly on the hardware environment. The hypervisor itself can be running directly on a hardware of a computer, which means without an underlying operating system, or as an application within a standard operating system like a Linux, Windows or others. Also virtual machine managers running on an intermediate instruction layer are known in the art.
Running a virtual machine on a hypervisor comprises the hypervisor providing a virtual environment comprising virtualized and virtual devices, as usually available as real hardware devices in the hardware environment. Accordingly, real hardware devices of the hardware environment have to be mapped to virtualized devices, so that they can be used by the virtual machine. In contrast, the pure virtual devices are not linked to any real hardware device. Depending on the requirements of a virtual machine or available resources, different configurations comprising virtual and virtualized devices can be provided for running a virtual machine. Also modifications on the hardware environment, e.g. by adding or removing devices, have to be adapted for the virtual environment. Furthermore, availability of virtual devices can be limited for performance reasons.
Accordingly, configuration of a virtual environment for a virtual machine is an important task for efficiently running the virtual machine and efficiently using the resources of the hypervisor. It is known in the art to provide and change a configuration of a virtual machine persistently only when the virtual machine is not running. This makes configuration changes very time-consuming because the configuration can only be tested after starting the virtual machine. It is further known, e.g. from the U.S. Publication No. 2010/0138829A1 entitled “Systems and Methods for Optimizing Configuration of a Virtual Machine Running at Least One Process,” Hanquez et al., published Jun. 3, 2010, which is hereby incorporated by reference herein in its entirety, to change a configuration of a virtual machine at runtime. Nevertheless, these changes are lost when the virtual machine is stopped. When restarting the virtual machine, the configuration changes have to be applied again, so that time is lost.